package com.mxx.common.websecurity;


import com.mxx.common.exception.UnImplementedException;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.session.SessionInformationExpiredEvent;

import javax.servlet.http.HttpServletRequest;

/**
 * @Auther: Mr. Zeng
 * @Date: 2020/7/21 11:11
 * @Description: 管理员登录执行
 */
@EnableWebSecurity
public interface AuthenticationBodyHandler extends UserDetailsService {
    default Object responseBodyOfSuccessful(HttpServletRequest httpServletRequest, Authentication authentication) {
        throw new UnImplementedException("AuthenticationBodyHandler.responseBodyOfSuccessful(httpServletRequest,authentication) UnImplemented");
    }

    default Object responseBodyOfFailure(AuthenticationException authenticationException) {
        throw new UnImplementedException("AuthenticationBodyHandler.responseBodyOfFailure(authenticationException) UnImplemented");
    }


    default Object responseBodyOfSessionFailure(AuthenticationException authenticationException) {
        throw new UnImplementedException("AuthenticationBodyHandler.responseBodyOfSessionFailure(authenticationException) UnImplemented");
    }

    default Object responseBodyOfSessionExpired(SessionInformationExpiredEvent sessionInformationExpiredEvent) {
        throw new UnImplementedException("AuthenticationBodyHandler.responseBodyOfSessionExpired(sessionInformationExpiredEvent) UnImplemented");
    }

}
